import request from '@/utils/request'
import {download} from '@/utils/request'
import {getNowDate} from '@/utils/tools.js'


// 提交开户申请
export function openFinance(data) {
  return request({
    url: '/system/acddShopMessage/openAccountApply',
    method: 'post',
    data
  })
}


// 修改支付密码
export function editPayPassword(data) {
  return request({
    url: '/system/acddShopMessage/editPayPassword',
    method: 'post',
    data
  })
}

// 财务首页
export function getFinanceIndex() {
  return request({
    url: '/system/acddShopMessage/index',
    method: 'get'
  })
}

// 资金记录
export function getLogList(params) {
  return request({
    url: '/system/acddShopMessage/capitalLogList',
    method: 'get',
    params
  })
}


// 导出
export function exportShopFinance(params, filename) {
  return download('/system/acddShopMessage/capitalLogListExport', params, `${filename}${getNowDate()}.xlsx`)
  // return request({
  //   url: '/system/acddFinance/export',
  //   method: 'post',
  //   data
  // })
}


// 随机密码因子
export function getRandom() {
  return request({
    url: '/system/llianPay/getRandom',
    method: 'post'
  })
}

// 提交开户
export function submitOpenAccount(data) {
  return request({
    url: '/system/acddShopMessage/submitOpenAccount',
    method: 'post',
    data
  })
}


// 提现手续费
export function shopWithdrawalMoney(params) {
  return request({
    url: '/system/acddShopMessage/shopWithdrawalMoney',
    method: 'get',
    params
  })
}



// 商户提现
export function shopWithdrawal(data) {
  return request({
    url: '/system/acddShopMessage/shopWithdrawal',
    method: 'post',
    data
  })
}


export function recognitionBusinessLicense(params) {
  return request({
    url: '/system/acddShopMessage/recognitionBusinessLicense',
    method: 'get',
    params
  })
}

export function openAccountApply(data) {
  return request({
    url: '/system/acddShopMessage/openAccountApply',
    method: 'post',
    data
  })
}

export function shopIDZ(params) {
  return request({
    url: '/system/acddShopMessage/recognitionIDCardFront',
    method: 'get',
    params
  })
}

export function shopIDF(params) {
  return request({
    url: '/system/acddShopMessage/recognitionIDCardBack',
    method: 'get',
    params
  })
}